<h1>
	<a href="<?php echo $this->url(array('action' => 'index', 'controller' => 'index'), null, true) ?>">Projects</a> &raquo;
	<a href="<?php echo $this->url(array('action' => 'project', 'controller' => 'index', 'project' => $this->project->getProjectKey()), null, true) ?>">
		<?php echo $this->escape($this->project->getName()) ?>
	</a>
</h1>


<div class="<?php echo $this->build->getStatus() ?>" id="build">
	<h2>
		<a href="<?php echo $this->url(array('action' => 'project', 'controller' => 'index', 'project' => $this->build->getProjectKey(), 'build' => $this->build->getBuildKey())) ?>">
            <?php echo $this->build->getName() ?>
        </a>
	</h2>
	<?php if (is_object($this->build->getComment())): ?>
		<div>
			<pre><?php echo $this->escape($this->build->getComment()->getCommitComment()) ?></pre>
		</div>
		<div class="meta">
			by <em><?php echo $this->escape($this->build->getComment()->getCommitAuthor()) ?></em>
			on <em><?php echo $this->escape($this->build->getComment()->getCommitTime()) ?></em>
		</div>
	<?php endif; ?>
</div>
<div id="output">
	<div class="pre">
		<?php foreach ($this->build->getLogs() as $log):
        if ($log->exists()):
            echo $log->format($this->escape($log->getContent()));
        endif;
       endforeach;
        ?>
		</div>
</div>

<ul id="builds">
    <?php foreach ($this->project->getPrevBuilds($this->build->getBuildKey()) as $build): ?>
		<li class="<?php echo $build->getStatus() ?>">
			<a href="<?php echo $this->url(array('action' => 'project', 'controller' => 'index', 'project' => $build->getProjectKey(), 'build' => $build->getBuildKey())) ?>">
                <?php echo $build->getName() ?>
         </a>
         <?php if (is_object($build->getComment())): ?>
				<div class="meta">
					by <em><?php echo $this->escape($build->getComment()->getCommitAuthor()) ?></em>
					on <em><?php echo $this->escape($build->getComment()->getCommitTime()) ?></em>
				</div>
			<?php endif; ?>
		</li>
	<?php endforeach; ?>
</ul>
